home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1996 July
/
Macworld (1996-07).dmg
/
System 7.5 Update 2.0
/
FileMaker Pro 3.0 CD Extras
/
FileMaker And Apple Events
/
Sample Applications
/
Relational Data
/
Get Related Data
next >
Wrap
Text File
|
1996-01-25
|
1KB
|
38 lines
-- one line examples
tell application "FileMaker Pro"
tell database "Master File"
record 1 -- get entire record including portal
cell "Related File::Product ID" -- get related cell by name
cell 2 -- get related cell by number
cell ID {1, {1, 2}} -- get related cell by ID
field "Related File::Product ID" -- get related field by name
field 2 -- get related field by number
field ID {1, 2} -- get related field by ID
every field whose name contains "::" -- get all related fields from a layout
end tell
end tell
getRelationshipsfromFieldNames()
--this routine returns the name of every relationship based on all related fields on the current layout
--note that you can get the name of the related file is the relationship name is the same as the related file
on getRelationshipsfromFieldNames()
tell application "FileMaker Pro"
set relationshipNames to {}
tell database "Master File"
--create a list of the names of all related fields
set relatedFields to name of every field whose name contains "::"
--extract the name of the related file from each related field
repeat with fieldName in relatedFields
set relationshipNames to relationshipNames & (characters 1 thru ((offset of "::" in fieldName) - 1) of fieldName as string)
end repeat
--return the list of related file names
return relationshipNames
end tell
end tell
end getRelationshipsfromFieldNames